package cn.itsource.ymjs.doc;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * 课程es分词
 */
@Document(indexName = "ymjs", type = "course")
@Data
public class CourseDoc {

    @Id //文档对象的ID就是该字段的值
    private Long id;
    //课程名称
    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String name;
//    //价格
//    @Field(type = FieldType.Float)
//    private BigDecimal price;
    //适用人群
    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String forUser;
    //等级名
    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String gradeName;
    //简介
    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String intro;
    //图片
    @Field(type = FieldType.Keyword,index = false)
    private String pic;
    //课程等级id
    @Field(type = FieldType.Long)
    private Long gradeId;
}
